package HomeWork;

import java.util.Scanner;

/*
统计一个字符串中大写字母字符，小写字母字符，数字字符出现的次数。(不考虑其他字符)
 */
public class Test03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        System.out.println("请输入：");
        String str = sc.nextLine();

        char[] chr = str.toCharArray();

        int bigCount=0;
        int smallCount=0;
        int numCount=0;
        for (int i = 0; i < chr.length; i++) {
            if(chr[i] >= 'A' && chr[i] <= 'Z'){
                bigCount++;
            } else if (chr[i] >= 'a' && chr[i] <= 'z') {
                smallCount++;
            }else{
                numCount++;
            }
        }

        System.out.println("大写字母数为："+bigCount);
        System.out.println("小写字母数为："+smallCount);
        System.out.println("数字数为："+numCount);
    }


}
